package com.graduationpractice.dbot.config;

import com.graduationpractice.dbot.tool.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new Filter()).addPathPatterns("/**")
                .excludePathPatterns("/login","/register","/checkvercode",
                        "/findpassword","/updatepassword","/user/login","/user/register",
                        "/user/checkvercode","/user/updatepassword","/email/**","/404","/",
                        "/css/**","/fonts/**","/img/**","/js/**","/vendor/**"
                );
    }
}
